<?php
set_include_path ( $_SERVER ['DOCUMENT_ROOT'] );
include_once 'admin/includes/functions/admin-functions.php';
global $SMARTY;

if(empty($_SESSION['user']['admin'])){
  die("用户状态已经过期. 请 <a href='/admin/login'>登录</a>.");
}

$tpl = $_POST['template'];
if(!file_exists("{$SMARTY->template_dir[0]}".$tpl)){
	die();
}
foreach($_POST as $key => $var){
	$SMARTY->assign("{$key}",$var);
}
$SMARTY->display("{$tpl}");